package com.neuedu.demo1;

public class Ex03 {
    public static void main(String[] args) {
        //控制行数
        for (int i = 0; i < 5; i++) {
            //控制空格数
            for (int j = 0; j < 4-i; j++) {
                System.out.print(" ");
            }
            //控制星星数
            for (int j = 0; j < 2*i+1; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
        for (int i = 4; i >0; i--) {
            for (int j = 0; j < 5-i; j++) {
                System.out.print(" ");
            }
            for (int j = 0; j < 2*i-1; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
